/**
 * Created by congzhang on 17/11/8.
 */

var exec = require('child_process').exec;
var path = require('path');

const BASENAME = path.dirname(__dirname);


// ffmpeg -i 1515560089336_20170919_王美平-1.mp4 2>&1| grep "Duration" | awk -F ',' '{print $1}' |awk '{print $2}'


var videoPath = "/video/1515560089336_20170919_王美平-1.mp4";
var source_file_path = path.join(BASENAME + videoPath);

var shell = "/usr/bin/ffmpeg -i " + source_file_path +" 2>&1| grep 'Duration' | awk -F ',' '{print $1}' |awk '{print $2}' ";

console.log(shell)
var last = exec(shell);

last.stdout.on('data', function (data) {
	console.log('标准输出：' + data);
});
